import enum


class BugStatus(enum.Enum):

    new = 7
    incomplete = 6
    invalid = 5
    wont_fix = 4
    in_progress = 3
    fix_committed = 2
    fix_released = 1


# 枚举成员具有无序性， 只支持同一性和相等性比较，不支持大小比较
actual_status = BugStatus.wont_fix
desired_status = BugStatus.fix_released

print('Equality:',
      actual_status == desired_status,
      actual_status == BugStatus.wont_fix)
print('Identity:',
      actual_status is desired_status,
      actual_status is BugStatus.wont_fix)
print('Ordered by value:')
try:
    print('\n'.join('  ' + s.name for s in sorted(BugStatus)))
except TypeError as err:
    print(' Cannot sort: {}'.format(err))
